﻿namespace Actya.Core.Security
{
	public interface IMembershipService
	{
		/// <summary>
		/// Authenticate.
		/// </summary>
		/// <param name="username"></param>
		/// <param name="password"></param>
		/// <returns></returns>
		User AuthenticateUser(string username, string password);

		/// <summary>
		/// Get a user by its username.
		/// </summary>
		/// <param name="username"></param>
		/// <param name="isUserOnline"></param>
		/// <returns></returns>
		User GetUserByUsername(string username, bool isUserOnline);

		/// <summary>
		/// Create a new role. When the role already exists, nothing is done.
		/// </summary>
		/// <param name="roleName"></param>
		void CreateRole(string roleName);

		/// <summary>
		/// Create a new user. When the user already exists, the existing user is returned.
		/// </summary>
		/// <param name="username"></param>
		/// <param name="password"></param>
		/// <param name="defaultRole"></param>
		/// <returns></returns>
		User CreateUser(string username, string password, string defaultRole);
	}
}
